package com.wsc.personalblog.mapper;

import com.wsc.personalblog.DTO.UserDTO;
import com.wsc.personalblog.entity.User;
import com.wsc.personalblog.entity.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface UserMapper {
    int countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User getUserAndRoleInfoByUsername(@Param("username")String username);

    User getUserAndRoleInfoByMail(String username);

    void updateAvatar(@Param("fileName")String fileName,@Param("userId")Integer userId);

    void updateUsername(@Param("username")String username,@Param("userId")Integer userId);

    void updatePassword(@Param("newPassword")String newPassword,@Param("userId")Integer userId);

    void removeRole(@Param("id") Integer id);
}